package Generator;
import Manage.Counter;
import turrets.*;
import info.gridworld.grid.Location;
public class Land extends Terrain{
	public void CreateTurret(){
		Location loc = new Location(getLocation().getRow(), getLocation().getCol(), getLocation().getDep());
		if (loc != null){
			if (Counter.getMoney() - 480 < 0){
				world.OutputMoneyError();
			}
			else{
				Turret b = new Turret();
				removeSelfFromGrid(getLocation());
				b.putSelfInGrid(getGrid(), loc);
			}
		}
		world.setMessage("Level: " + Generate.getLevel() + "\n" + "Lives: " + Counter.getLives() + "\n" + "Kills: "  + Counter.getKills() + "\n" + "Money: " + Counter.getMoney());
	}
	public void CreateSniper(){
		Location loc = new Location(getLocation().getRow(), getLocation().getCol(), getLocation().getDep());
		if (loc != null){
			if (Counter.getMoney() - 600 < 0){
				world.OutputMoneyError();
			}
			else{
				Sniper b = new Sniper();
				removeSelfFromGrid(getLocation());
				b.putSelfInGrid(getGrid(), loc);
			}
		}
		world.setMessage("Level: " + Generate.getLevel() + "\n" + "Lives: " + Counter.getLives() + "\n" + "Kills: "  + Counter.getKills() + "\n" + "Money: " + Counter.getMoney());
	}
	public void CreateSpray(){
		Location loc = new Location(getLocation().getRow(), getLocation().getCol(), getLocation().getDep());
		if (loc != null){
			if (Counter.getMoney() - 840 < 0){
				world.OutputMoneyError();
			}
			else{
				Spray b = new Spray();
				removeSelfFromGrid(getLocation());
				b.putSelfInGrid(getGrid(), loc);
			}
		}
		world.setMessage("Level: " + Generate.getLevel()+ "\n"  + "Lives: " + Counter.getLives() + "\n" + "Kills: "  + Counter.getKills() + "\n" + "Money: " + Counter.getMoney());
	}
	public void CreateSuperTurret(){
		Location loc = new Location(getLocation().getRow(), getLocation().getCol(), getLocation().getDep());
		if (loc != null){
			if (Counter.getMoney() - 10000 < 0){
				world.OutputMoneyError();
			}
			else{
				SuperTurret b = new SuperTurret();
				removeSelfFromGrid(getLocation());
				b.putSelfInGrid(getGrid(), loc);
			}
		}
		world.setMessage("Level: " + Generate.getLevel() + "\n" + "Lives: " + Counter.getLives() + "\n" + "Kills: "  + Counter.getKills() + "\n" + "Money: " + Counter.getMoney());
	}
	public void CreateCannon(){
		Location loc = new Location(getLocation().getRow(), getLocation().getCol(), getLocation().getDep());
		if (loc != null){
			if (Counter.getMoney() - 960 < 0){
				world.OutputMoneyError();
			}
			else{
				Cannon b = new Cannon();
				removeSelfFromGrid(getLocation());
				b.putSelfInGrid(getGrid(), loc);
			}
		}
		world.setMessage("Level: " + Generate.getLevel() + "\n" + "Lives: " + Counter.getLives() + "\n" + "Kills: "  + Counter.getKills() + "\n" + "Money: " + Counter.getMoney());
	}
}
